

<button nz-button nzType="primary" style="margin-bottom: 10px" (click)="add()">+ 新增</button>
<nz-table #basicTable
          [nzScroll]="{y: '640px' }"
          [nzFrontPagination]="false"
          [nzData]="listOfData">
  <thead>
  <tr>
    <th>字段名</th>
    <th>显示</th>
    <th>是否必填</th>
    <th>添加时间</th>
    <th nzWidth="100px">操作</th>
  </tr>
  </thead>
  <tbody>
  <tr *ngFor="let data of basicTable.data">
    <td>{{data.filedName}}</td>
    <td><nz-switch [ngModel]="data.isShow == 1" (ngModelChange)="changeShow(data)"></nz-switch></td>
    <td>{{isRequired(data)}}</td>
    <td>{{data.gmtCreated}}</td>
    <td>
      <a nz-button nzType="link" (click)="edit(data)">修改</a>
    </td>
  </tr>
  </tbody>
</nz-table>

<nz-modal
  nzTitle="新增订单字段"
  [(nzVisible)]="isVisible"
  [nzMaskClosable]="false"
  (nzOnCancel)="handleCancel()"
  (nzOnOk)="handleOk()">
  <ng-container *nzModalContent>
    <form nz-form [formGroup]="validateForm">
      <nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="filedName" nzRequired>字段名</nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入姓名">
          <input nz-input formControlName="filedName" />
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="isRequired">是否必填</nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24">
          <nz-radio-group formControlName="isRequired">
            <label nz-radio [nzValue]="0">否</label>
            <label nz-radio [nzValue]="1">是</label>
          </nz-radio-group>
        </nz-form-control>
      </nz-form-item>
    </form>
  </ng-container>
</nz-modal>
